<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>New Mechanical for ${Taller.name}</title>
    <meta name="layout" content="main">
  </head>
  <body>
    <br>
    <g:link class="list" action="newCustomer">
      <div class="tabNoSelected">
        Customer
      </div>
    </g:link>
    <g:link class="list" action="newMechanical">
      <div class="tabSelected">
        Mechanical Tecnician
      </div>
    </g:link>
    <g:link class="list" action="newServicePackage">
      <div class="tabNoSelected">
          Services Packages
      </div>
    </g:link>
    <g:link class="list" action="edit" id="${Taller.id}">
      <div class="tabNoSelected">
       Edit My data
      </div>
    </g:link> 
    <g:link class="list" action="logout" controller="LogIn">
      <div class="tabNoSelected">Log Out</div>
    </g:link>
    <div class="tabContent"> 
      <g:link class="list" action="newMechanical" >
        <div class="tabSelected">
          New
        </div>
      </g:link>
      <g:link class="list" action="listMechanical" >
        <div class="tabNoSelected">
          List
        </div>
      </g:link>
    </div>
    <hr>
    
    <g:if test="${flash.message}">
    <div class="message" role="status">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${mechanicalTechnicianInstance}">
    <ul class="errors" role="alert">
            <g:eachError bean="${mechanicalTechnicianInstance}" var="error">
            <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
            </g:eachError>
    </ul>
    </g:hasErrors>
    
  <g:form action="saveMechanical">
    <fieldset class="form">
      
      <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'name', 'error')} required">
              <label for="name">
                      <g:message code="mechanicalTechnician.name.label" default="Name" />
                      <span class="required-indicator">*</span>
              </label>
              <g:textField name="name" required="" value="${mechanicalTechnicianInstance?.name}"/>
      </div>

      <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'speciality', 'error')} required">
              <label for="speciality">
                      <g:message code="mechanicalTechnician.speciality.label" default="Speciality" />
                      <span class="required-indicator">*</span>
              </label>
              <g:textField name="speciality" required="" value="${mechanicalTechnicianInstance?.speciality}"/>
      </div>

      <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'address', 'error')} required">
              <label for="address">
                      <g:message code="mechanicalTechnician.address.label" default="Address" />
                      <span class="required-indicator">*</span>
              </label>
              <g:textField name="address" required="" value="${mechanicalTechnicianInstance?.address}"/>
      </div>

      <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'phone', 'error')} required">
              <label for="phone">
                      <g:message code="mechanicalTechnician.phone.label" default="Phone" />
                      <span class="required-indicator">*</span>
              </label>
              <g:textField name="phone" maxlength="10" required="" value="${mechanicalTechnicianInstance?.phone}"/>
      </div>

      <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'password', 'error')} required">
              <label for="password">
                      <g:message code="mechanicalTechnician.password.label" default="Password" />
                      <span class="required-indicator">*</span>
              </label>
              <g:passwordField name="password" maxlength="15" required="" value="${mechanicalTechnicianInstance?.password}"/>
      </div>
      
      <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'password', 'error')} required">
	<label for="confirmPassword">
		<g:message code="Confirm Password" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="password" name="confirmPassword" maxlength="15" required="" value="${mechanicalTechnicianInstance?.confirmPassword}"/>
      </div>
      
      <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'repairShop', 'error')} required">
              <g:hiddenField name="repairShop.id" value="${Taller.id}"/>
      </div>

      <div class="fieldcontain ${hasErrors(bean: mechanicalTechnicianInstance, field: 'username', 'error')} ">
              <label for="username">
                      <g:message code="mechanicalTechnician.username.label" default="Username" />

              </label>
              <g:textField name="username" value="${mechanicalTechnicianInstance?.username}"/>
      </div>
      </fieldset>
      <fieldset class="buttons">
        <g:submitButton name="create" class="save" value="${message(code: 'Create')}" />
      </fieldset>
    </g:form>
  </body>
</html>
